import {
  selectAllRole
} from '@/api/createWorkOrderType'
import {
  themeColor
} from "@/api/eripDataSynController.js"
export function roleList(resolve) {
  let roleList = []
  selectAllRole('role').then(res => {
    if (res.data.retCode === 200) {
      roleList = res.data.data
      resolve(roleList)
    }
  })
}
export function userList(resolve) {
  let userList = []
  selectAllRole('user').then(res => {
    if (res.data.retCode === 200) {
      userList = res.data.data
      resolve(userList)
    }
  })
}
export function deptList(resolve) {
  let deptList = []
  selectAllRole('dept').then(res => {
    if (res.data.retCode === 200) {
      deptList = res.data.data
      resolve(deptList)
    }
  })
}

export function getThemeColor (resolve) {
  let data_theme = ''
  themeColor().then(res => {
    if (res.data.retCode == 200) {
      data_theme = res.data.data[0].codeValue
      resolve(data_theme)
    }
  })
}
export default {
  roleList,
  userList,
  deptList,
  getThemeColor
}
